{% if "detail" in buttons %}
    <a href="{{ record.get_absolute_url }}?return_url={{ request.path }}{{ return_url_extra }}" class="btn btn-sm btn-secondary" title="Details">
        <span class="mdi mdi-information-outline"></span>
    </a>
{% endif %}
{% if "changelog" in buttons %}
    <a href="{% url changelog_route pk=record.pk %}" class="btn btn-secondary btn-sm" title="Change log">
        <span class="mdi mdi-history"></span>
    </a>
{% endif %}
{% if "approve" in buttons and have_permission and record.is_active_stage and can_approve %}
    <span title='{% if request.user in record.users_that_already_approved %}You already approved this stage{% else %}Approve this stage{% endif %}'>
        {% if request.user not in record.users_that_already_approved %}
            <a href="{% url approval_route pk=record.pk %}?return_url={{ request.path }}{{ return_url_extra }}"
               class="btn btn-success btn-sm">
                <span class="mdi mdi-check"></span>
            </a>
        {% else %}
            <a aria-disabled="true" class="btn btn-success btn-sm disabled">
                <span class="mdi mdi-check"></span>
            </a>
        {% endif %}
    </span>
{% endif %}
{% if "deny" in buttons and have_permission and record.is_active_stage and request.user not in record.users_that_already_approved and can_approve %}
    <span title='{%if request.user in record.users_that_already_approved %}You already approved this stage{% else %}Deny this stage{% endif %}'>
        {% if request.user not in record.users_that_already_approved %}
            <a href="{% url deny_route pk=record.pk %}?return_url={{ request.path }}{{ return_url_extra }}"
               class="btn btn-danger btn-sm">
                <span class="mdi mdi-close"></span>
            </a>
        {% else %}
            <a aria-disabled="true" class="btn btn-danger btn-sm disabled">
                <span class="mdi mdi-close"></span>
            </a>
        {% endif %}
    </span>
{% endif %}
{% if "comment" in buttons and have_permission and record.is_not_done_stage %}
    <span title='Comment this stage'>
        <a href="{% url comment_route pk=record.pk %}?return_url={{ request.path }}{{ return_url_extra }}"
           class="btn btn-secondary btn-sm">
            <span class="mdi mdi-comment-text-outline"></span>
        </a>
    </span>
{% endif %}
